﻿using Autofac;
using King.Box.Service.Impl;

namespace King.Box.Service.Modules
{
    public class ServicesModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterGeneric(typeof(DataService<>)).As(typeof(IDataService<>)).InstancePerDependency();
            
            builder.RegisterType<DbInitService>().As<IDbInitService>().SingleInstance();
            builder.RegisterType<BasicService>().As<IBasicService>().SingleInstance();

            builder.RegisterType<SafetyService>().As<ISafetyService>().SingleInstance();
            builder.RegisterType<HomeService>().As<IHomeService>().SingleInstance();
            builder.RegisterType<SysService>().As<ISysService>().SingleInstance();
        }
    }
}
